/*
 * @lc app=leetcode.cn id=1 lang=javascript
 *
 * [1] 两数之和
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @param {number} target
 * @return {number[]}
 */
var twoSum = function (nums, target) {

    let map=new Map
    for (let i = 0; i < nums.length; i++) {
        let complete=target-nums[i]
        if(map.has(complete)){
            console.log( [map.get(complete),i])
            return [map.get(complete),i]
        }else{
            map.set(nums[i],i)
        }
        


        
    }



};

twoSum([2,7,7,6],13)





// @lc code=end

